package com.yh.csx.bsf.flow.core.util;

import lombok.val;

import java.util.ArrayList;
import java.util.Collection;

/**
 * @author: chejiangyi
 * @version: 2019-11-03 12:34
 **/
public class ArrayUtil {
    public static  <T> ArrayList<T> asList(T[] array){
        val rs = new ArrayList<T>();
        for(val o:array){
            rs.add(o);
        }
        return rs;
    }

    public static String sqlIn(Collection objects){
        StringBuilder sb = new StringBuilder();
        for(val obj:objects){
            sb.append("'"+obj+"',");
        }
        return org.springframework.util.StringUtils.trimTrailingCharacter(sb.toString(),',');
    }
}
